home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pi-5ways.zip
/
READ.ME
< prev
Wrap
Text File
|
1991-06-15
|
989b
|
25 lines
FIVE WAYS TO CALCULATE π
The five included files illustrate different methods to appoximate π. PI1.C,
PI2.C, and PI3.C use series expansions. CANNON.C simulates firing a cannon
at a circular pond enclosed (inscribed) in a square of land. PINDROP.C is
the notorious pin drop simulation, whereby you drop a pin on a wood plank
floor, keep track of how many times the pin falls on a crack, and take the
ratio of "hits" to total drops.
The source code should compile with no problems on just about any version of
C, with a couple of trivial changes. You may have to " #include <math.h>" at
the beginning of the files. A couple of the files use the function
"clrscrn()", which clears the screen. You may need to substitute an
equivalent function call, or just plain delete that line.
These files are placed into the Public Domain for educational purposes.
Enjoy.
Mendel Cooper
3138 Foster Ave.
Baltimore, MD 21224
06/91